package FirstExam10tasks;

public class Task3 {

	public static void main(String[] args)
	{
		int x = 3;
		int y = 3;
		
		System.out.println("result " + calculateNumbers(x, y) * x);
	}
	
	public static int calculateNumbers ( int x, int y)
	{
		if(y == 0)
		{
			return 0;
		}
			
		else
		{
			x = ( x + (calculateNumbers(x, --y))) ;
			return x;
		}

	}

}
